package com.zjitc.service.impl;

import com.zjitc.dao.UserDao;
import com.zjitc.model.User;
import com.zjitc.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/4/12 17:06
 * @description:
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;

  @Override
  public User login(String username, String password) {
    return userDao.findByUsernameAndPassword(username,password);
  }

  @Override
  public int regist(User user) {
    return userDao.insert(user);
  }
}
